package com.lanyun.service;

import com.lanyun.pojo.Admin;
import com.lanyun.pojo.SalesOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 销售订单业务层接口
 */
public interface SalesOrderService {
    List<SalesOrder> getAll();

    int addOrderAndDetail(String cid,String salesmanId,String[] pids,String[] amounts);

    SalesOrder getById(String id);

    List<Map<String,String>> getDetailsById(String id);

    int updateDetail(String oid,String[] pids,String[] amounts);

    //根据订单id和库管员id查到库管员能够操作的商品信息
    List<Map<String,String>> getProductsByKeeperAndOrder(String oid, String keeperId);

    int outWareHouse(String oid,String pid,String wid,String amount,String keeperId);

    List<SalesOrder> getByCondition(String customerName, String salesmanName,String keeperName,
                                    Date enterDateStart,Date enterDateEnd, Date outDateStart,Date outDateEnd,String state);

    int isBegined(String oid);

    int delById(String oid);

    int delBatch(String[] ids);

    List<SalesOrder> getByKeeper(Admin keeper);
}
